#define _CRT_SECURE_NO_WARNINGS 1
int* selfDividingNumbers(int left, int right, int* returnSize) {
    int* p = (int*)malloc(sizeof(int) * (right - left));
    *returnSize = 0;
    for (int i = left; i <= right; i++)
    {
        int k = i;
        while (k)
        {
            if (k % 10 == 0)
                break;
            if (i % (k % 10) != 0)
                break;
            k /= 10;
        }
        if (k == 0)
            p[(*returnSize)++] = i;
    }
    return p;
}